package org.bwf.study;

import org.bwf.obj.bo.*;
import org.bwf.study.servcie.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@SpringBootTest(classes = CatEyeApplication.class)
@RunWith(SpringRunner.class)
public class CatEyeTestApplication {

    @Autowired
    private UserService userService;

    @Test
    public void UserRegisterTest(){
        UserRegisterBO userRegisterBO = new UserRegisterBO();

        userRegisterBO.setUserPhone("13917703935");
        userRegisterBO.setValCode("778529");
        userRegisterBO.setUserLoginName("13917703935");
        userRegisterBO.setUserEmail("andy@163.com");
        userRegisterBO.setNickName("强森");
        userRegisterBO.setUserLoginPass("123456");
        userService.Register(userRegisterBO);
    }

    @Test
    public void userLoginTest(){
        UserLoginBO userLoginBO = new UserLoginBO();
        userLoginBO.setUserLoginName("13917703935");
        userLoginBO.setUserLoginPass("123456");
        userService.Login(userLoginBO);

    }

    @Autowired
    @Qualifier("filmServiceEsImpl")
    private FilmService filmService;

    @Test
    public void FilmQueryListTest(){
        FilmQueryListBO filmQueryListBO = new FilmQueryListBO();
        filmQueryListBO.setCateId(4);
        filmService.FilmQueryList(filmQueryListBO);
    }

    @Test
    public void FilmQueryModelTest(){
        filmService.FilmQueryModel(428);
    }

    @Autowired
    private IndexService indexService;
    @Test
    public void IndexQueryListTest(){
        indexService.Load();
    }

    @Autowired
    private CinemaService cinemaService;
    @Test
    public void CinemaQueryListTest(){
        CinemaQueryListBO bo = new CinemaQueryListBO();
        bo.setBrandId(188982);
        cinemaService.CinemaQueryList(bo);
    }

    @Test
    public void CinemaQueryModelTest(){
        cinemaService.CinemaQueryModel(64);
    }

    @Autowired
    private OrderService orderService;
    @Test
    public void SelectQuerySiteTest(){
        SelectQuerySiteBO selectQuerySiteBO = new SelectQuerySiteBO();
        selectQuerySiteBO.setOrderCinemaId(71);
        selectQuerySiteBO.setOrderFilmId(38270);
        selectQuerySiteBO.setOrderWtId("202107290350341");
        selectQuerySiteBO.setSelectSiteInfo("{\"site_no\": \"000000018095-1-\", \"site_row\": \"1\", \"site_colum\": \"4\", \"site_state\": \"1\"}");
        orderService.SelectSite(selectQuerySiteBO);
    }

    @Autowired
    private WatchTimesService watchTimesService;
    @Test
    public void WatchTimesQueryModelTest(){
        watchTimesService.WatchTimesQueryModel("202107290356781");
    }
}
